package com.itheima.inputstream;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;

/*
文件字节输入流 一次读取多个字节
 */
public class Demo02 {

    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("day12\\aaa\\abc.txt");
        byte[] bytes=new byte[10];
        int length;
       /* while (true) {
            int read = fis.read(bytes);
            if(read==-1){
                break;
            }
            System.out.println(read+"读到了"+Arrays.toString(bytes));

        }*/
        while ((length=fis.read(bytes))!=-1){
            for (int i = 0; i < length; i++) {
                System.out.print((char)bytes[i]);
            }
        }

       fis.close();

    }
}
